﻿using Discord.Response;
using Newtonsoft.Json;

namespace Discord.Bot;

/// <summary>
/// 回调返回参数
/// </summary>
public class CallbackData
{
    [JsonProperty(PropertyName = "type")]
    public string Type { get; set; } = "";

    [JsonProperty(PropertyName = "id")]
    public ulong Id { get; set; }

    [JsonProperty(PropertyName = "content")]
    public string Content { get; set; } = "";

    [JsonProperty(PropertyName = "attachments")]
    public List<Attachment> AttachmentList { get; set; } = new();

    [JsonProperty(PropertyName = "embeds")]
    public List<Embed> EmbedList { get; set; } = new();

    [JsonProperty(PropertyName = "trigger_id")]
    public string TriggerId { get; set; } = "";
}

public class Attachment
{
    [JsonProperty(PropertyName = "id")]
    public ulong Id { get; set; }

    [JsonProperty(PropertyName = "url")]
    public string Url { get; set; } = "";

    [JsonProperty(PropertyName = "proxy_url")]
    public string ProxyUrl { get; set; } = "";

    [JsonProperty(PropertyName = "filename")]
    public string FileName { get; set; } = "";

    [JsonProperty(PropertyName = "content_type")]
    public string ContentType { get; set; } = "";

    [JsonProperty(PropertyName = "width")]
    public int Width { get; set; }

    [JsonProperty(PropertyName = "height")]
    public int Height { get; set; }

    [JsonProperty(PropertyName = "size")]
    public int Size { get; set; }

    [JsonProperty(PropertyName = "ephemeral")]
    public bool Ephemeral { get; set; }
}

public class Embed
{
    [JsonProperty(PropertyName = "type")]
    public string Type { get; set; } = "";

    [JsonProperty(PropertyName = "description")]
    public string Description { get; set; } = "";

    [JsonProperty(PropertyName = "image")]
    public EmbedsImage Image { get; set; } = new();
}

public class EmbedsImage
{
    [JsonProperty(PropertyName = "url")]
    public string Url { get; set; } = "";

    [JsonProperty(PropertyName = "proxy_url")]
    public string ProxyUrl { get; set; } = "";
}